package com.lq.ecoldchain.ui.mymileage.details

import com.lq.ecoldchain.base.CommonLoadingViewModel
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.instance
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2019/1/5 0005  20:17
*function by lq
*/
val mileageDetailKodeinModule = Kodein.Module("Mileage_Detail_Kodein_Module"){
    bind<MileageDetailViewModel>() with scoped(AndroidLifecycleScope).singleton {
        MileageDetailViewModel()
    }

    bind<MileageDetailDelegate>() with scoped(AndroidLifecycleScope).singleton {
        MileageDetailDelegate(
                viewModel = instance(),
                loadingViewModel = CommonLoadingViewModel.instance(context)
        )
    }
}